home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib25 / alarm.c < prev    next >
C/C++ Source or Header  |  1992-09-04  |  340b  |  27 lines

  1. /*
  2.  * alarm: a public domain alarm for MiNT (by ers)
  3.  */
  4.  
  5. #include <errno.h>
  6. #include <mintbind.h>
  7.  
  8. extern int __mint;
  9.  
  10. unsigned int
  11. alarm(secs)
  12.     unsigned secs;
  13. {
  14.     long r;
  15.  
  16.     if (__mint == 0)
  17.         r = -EINVAL;
  18.     else
  19.         r = Talarm((long)secs);
  20.  
  21.     if (r < 0) {
  22.         errno = - (int)r;
  23.         r = -1;
  24.     }
  25.     return (unsigned int) r;
  26. }
  27.